package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_course", schema = "test", catalog = "")
public class Course {
    private int cId;
    private String cName;
    private String cCtime;
    private String cContent;
    private String cExam;
    private int planId;

    @Id
    @Column(name = "c_id", nullable = false)
    public int getcId() {
        return cId;
    }

    public void setcId(int cId) {
        this.cId = cId;
    }

    @Basic
    @Column(name = "c_name", nullable = false, length = 8)
    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    @Basic
    @Column(name = "c_ctime", nullable = false, length = 20)
    public String getcCtime() {
        return cCtime;
    }

    public void setcCtime(String cCtime) {
        this.cCtime = cCtime;
    }

    @Basic
    @Column(name = "c_content", nullable = false, length = 255)
    public String getcContent() {
        return cContent;
    }

    public void setcContent(String cContent) {
        this.cContent = cContent;
    }

    @Basic
    @Column(name = "c_exam", nullable = false, length = 80)
    public String getcExam() {
        return cExam;
    }

    public void setcExam(String cExam) {
        this.cExam = cExam;
    }

    @Basic
    @Column(name = "plan_id", nullable = false)
    public int getPlanId() {
        return planId;
    }

    public void setPlanId(int planId) {
        this.planId = planId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Course course = (Course) o;

        if (cId != course.cId) return false;
        if (planId != course.planId) return false;
        if (cName != null ? !cName.equals(course.cName) : course.cName != null) return false;
        if (cCtime != null ? !cCtime.equals(course.cCtime) : course.cCtime != null) return false;
        if (cContent != null ? !cContent.equals(course.cContent) : course.cContent != null) return false;
        if (cExam != null ? !cExam.equals(course.cExam) : course.cExam != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = cId;
        result = 31 * result + (cName != null ? cName.hashCode() : 0);
        result = 31 * result + (cCtime != null ? cCtime.hashCode() : 0);
        result = 31 * result + (cContent != null ? cContent.hashCode() : 0);
        result = 31 * result + (cExam != null ? cExam.hashCode() : 0);
        result = 31 * result + planId;
        return result;
    }
}
